package com.hermit.server.enums;

/**
 * 文件用途管理枚举类
 */
public enum  FileUseEnum {
    COURSE("C","课程"),
    TEACHER("T","讲师");

    private String code;
    private String desc;

    FileUseEnum(String code,String desc){
        this.code = code;
        this.desc = desc;
    }
    public String getCode(){ return code; }
    public String getDesc(){ return desc; }
    public void setCode(String code){ this.code = code; }
    public void setDesc(String desc){ this.desc = desc; }

    public static FileUseEnum getByCode(String code){
        for(FileUseEnum e:FileUseEnum.values()){
            if(code.equals(e.getCode())){
                return e;
            }
        }
        return null;
    }
}
